package net.sunofbeach.ucenter.api;


import net.sunofbeach.ucenter.pojo.WxCode;
import net.sunofbeach.ucenter.response.ResponseResult;
import net.sunofbeach.ucenter.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sob
 * @since 2021-12-02
 */
@RestController
@RequestMapping("/ucenter/user")
public class UserController {

    @Autowired
    private IUserService userService;

    /*
     * 获取微信鉴权
     * */
    @PostMapping("/wxAuth")
    public ResponseResult postWxAuth (@RequestBody WxCode wxCode){
        return userService.wxAuth(wxCode);
    }

    @GetMapping("/list/{page}/{size}")
    public ResponseResult listUserByPage(@PathVariable("page")int page, @PathVariable("size") int size){
        return userService.listUserByPage(page,size);
    }



}

